//
// Created by cube on 2020/10/22.
//

#ifndef COMPILERDOMEA1_LIBRARY_H
#define COMPILERDOMEA1_LIBRARY_H


#if __linux
#include <dlfcn.h>
#endif

#if WIN32
#include <windowsx.h>
#endif

#include <string>

namespace LibraryCommon {

    namespace Base{
        void* open(const char* path,int model);
        void* get(void* pid_p,const char* identifier);
        int close(void* pid_p);
        char* error();
    }

    class Library{
    public:
        Library();
        Library(const std::string& path);
        void open(const std::string& path);
        void* get(const std::string& identifier);
        void close();

    private:
        void* __pid;
    };
};


#endif //COMPILERDOMEA1_LIBRARY_H
